package cn.iocoder.yudao.module.ym.api.ticket;

import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.infra.api.ticket.TicketApi;
import cn.iocoder.yudao.module.infra.api.ticket.dto.TicketDto;
import cn.iocoder.yudao.module.ym.controller.admin.ticket.vo.TicketPageReqVO;
import cn.iocoder.yudao.module.ym.controller.admin.ticket.vo.TicketRespVO;
import cn.iocoder.yudao.module.ym.dal.mysql.ticket.TicketMapper;
import cn.iocoder.yudao.module.ym.service.ticket.TicketService;
import jakarta.annotation.Resource;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TicketApiImpl implements TicketApi {
    @Resource
    private TicketService ticketService;



    @Override
    public List<TicketDto> getList() {
        List<TicketRespVO> ticketList = ticketService.getTicketList(new TicketPageReqVO());
        List<TicketDto> bean = BeanUtils.toBean(ticketList, TicketDto.class);
        return bean;
    }

    //获取今天的某人工单数的统计
    @Override
    public List<Map<Long, Object>> allCount(){
        return ticketService.allCount();
    }
    //获取今天的某人工单数的统计
    @Override
    public List<Map<Long, Object>> todayCount(){
        return ticketService.todayCount();
    }

    @Override
    public long countByUserIdAndStatus(Long userId,Integer type) {
        return ticketService.countByUserIdAndStatus(userId,type);
    }

    @Override
    public long todayCountByUserId(Long userId) {
        return ticketService.todayCountByUserId(userId);
    }

}
